import javax.swing.*;
import java.awt.*;

public class ChristmasTree extends JPanel {
    public void paintComponent(Graphics g) {
        super.paintComponent(g);

        // Draw the trunk
        g.setColor(new Color(102, 51, 0));
        g.fillRect(100, 250, 50, 100);

        // Draw the tree
        g.setColor(Color.green);
        g.fillOval(50, 100, 150, 150);
        g.fillOval(25, 150, 200, 200);
        g.fillOval(0, 200, 250, 250);

        // Draw the star
        g.setColor(Color.yellow);
        int[] xPoints = {125, 150, 175, 200, 162, 137};
        int[] yPoints = {50, 75, 50, 75, 100, 75};
        g.fillPolygon(xPoints, yPoints, 6);
    }

    public static void main(String[] args) {
        JFrame frame = new JFrame("Christmas Tree");
        frame.add(new ChristmasTree());
        frame.setSize(300, 400);
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
